<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    function Student(name, age) {
      this.name = name
      this.age = age
    }

    Student.prototype.study = function() {
      console.log(this.name + ' 学习')
    }

    const stu = new Student('小明', 18)
    stu.study()
    console.log(stu.toString())
    console.log(stu.sex)
    stu.eat()
  </script>
</body>
</html>